<template>
  <view class="seal-box">
    <view class="box-1" :style="{ borderColor: colors[status] }"></view>
    <view class="box-2" :style="{ borderColor: colors[status] }"></view>
    <view
      class="box-3"
      :style="{ borderColor: colors[status], color: colors[status] }"
      >{{ !mode ? pass[status] : res[status] }}</view
    >
  </view>
</template>

<script>
export default {
  data() {
    return {
      colors: {
        0: "red",
        1: "greenyellow",
        2: "yellow",
      },
      pass: {
        0: "不一致",
        1: "一致",
      },
      res: {
        0: "建议拒绝",
        1: "建议审核",
        2: "可信度高",
      },
    };
  },
  props: {
    value: 0,
    // 模式：0 短路 || 1 区间
    mode: 0,
  },
  computed: {
    //   0 red 1 green 2 yellow
    status() {
      if (!this.mode) {
        return this.value ? 0 : 1;
      } else {
        return (this.value >= 0) & (this.value < 21)
          ? 0
          : (this.value > 20) & (this.value < 66)
          ? 2
          : 1;
      }
    },
  },
};
</script>

<style>
.seal-box {
  position: relative;
  width: 180rpx;
  height: 150rpx;
  overflow: hidden;
  margin-bottom: 20rpx;
}

.box-1 {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 20;
  border: red 2px solid;
  width: 150rpx;
  height: 150rpx;
  border-radius: 50%;
}

.box-2 {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 21;
  border: red 2px solid;
  width: 120rpx;
  height: 120rpx;
  border-radius: 50%;
}
.box-3 {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) rotate(-20deg);
  z-index: 21;
  border: red 2px solid;
  width: 170rpx;
  height: 50rpx;
  line-height: 40rpx;
  background-color: white;
  text-align: center;
}
</style>
